Skip to content

ref!: Consolidate vendored code packages - #6796

Open
adinauer wants to merge 2 commits into
9.x.xfrom
ref/consolidate-vendored-code-v9
Open

adinauer wants to merge 2 commits into
9.x.xfrom
ref/consolidate-vendored-code-v9

Conversation

@adinauer

Copy link
Copy Markdown
Member

📜 Description

Consolidates third-party-derived implementations into upstream-oriented io.sentry.vendor.* namespaces across the core SDK, Android Core, Android Replay, OpenTelemetry bootstrap, and build logic.

This also:

  • extracts the adapted AndroidX Compose bounds helpers and Maven POM mutation logic from mixed-origin files
  • updates all internal call sites, package-coupled tests, API dumps, ProGuard references, and THIRD_PARTY_NOTICES.md scopes
  • widens package-private entry points only where cross-package access requires it and marks newly exposed implementation classes as internal

The old package names are removed without forwarding shims because this targets the Java SDK 9 major release. Consumers that directly imported these implementation types must update their imports. ANR events now report ApplicationNotResponding under the io.sentry.vendor.anrwatchdog module.

💡 Motivation and Context

Vendored implementations currently live across Sentry-owned namespaces, which obscures their upstream ownership and makes attribution, maintenance, and package-level tooling harder to reason about. Grouping them under io.sentry.vendor makes the boundary explicit while retaining the existing top-level vendor namespace used by Gson and other adapted utilities.

The package moves are intentionally grouped by upstream project, such as Tape, Seismic, ANR-WatchDog, Apache Commons Collections, AndroidX, OpenTelemetry, and flutter_screen_recorder.

💚 How did you test it?

  • make format api
  • ./gradlew check
  • Inspected the assembled JAR/AAR contents to confirm the new vendor paths are present and the old paths are absent

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Coordinate rebases for #6779, #6785, and #6666 because they touch files moved by this PR.

Move third-party-derived implementations into io.sentry.vendor namespaces and update internal call sites, tests, attribution, ProGuard rules, and ABI dumps. This keeps vendored origins explicit for Java SDK 9.
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/QueuedThreadPoolExecutor.java

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR risk: high

For commit 4c5e61d.

Main concerns: public contract, dependencies customers inherit, reach.

Rules that block low also fired:

  • R1: code was truncated, omitted or a reduced context was used: sentry-android-core/src/main/java/io/sentry/vendor/aosp/threaddump/ThreadDumpParser.java, sentry-android-core/src/main/java/io/sentry/vendor/breadwallet/RootChecker.java, sentry-android-core/src/main/java/io/sentry/vendor/firebase/FirstDrawDoneListener.java, sentry-android-core/src/main/java/io/sentry/vendor/seismic/SentryShakeDetector.java, sentry-android-core/src/test/java/io/sentry/android/core/AnrIntegrationTest.kt and 61 more
  • R4: a public API record changed: sentry-android-core/api/sentry-android-core.api, sentry-android-replay/api/sentry-android-replay.api, sentry-opentelemetry/sentry-opentelemetry-bootstrap/api/sentry-opentelemetry-bootstrap.api, sentry/api/sentry.api
  • R6: build or release configuration changed: build-logic/src/main/kotlin/io/sentry/gradle/AarTypes.kt, build-logic/src/main/kotlin/io/sentry/vendor/androidx/maven/AarTypes.kt, sentry-android-core/proguard-rules.pro

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 27, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.66.0 (1) release

⚙️ sentry-android Build Distribution Settings

@adinauer
adinauer marked this pull request as ready for review November 27, 2026 11:29
@adinauer
adinauer requested a review from a team as a code owner November 27, 2026 11:29
@adinauer
adinauer requested review from markushi and runningcode and removed request for a team November 27, 2026 11:29
@github-actions github-actions Bot added risk: high PR risk score: high and removed risk: high PR risk score: high labels Nov 27, 2026
@@ -3,7 +3,7 @@
// Licensed under the MIT License.
// https://github.com/SalomonBrys/ANR-WatchDog/blob/1969075f75f5980e9000eaffbaa13b0daf282dcb/anr-watchdog/src/main/java/com/github/anrwatchdog/ANRError.java
// The API unnecessary here was removed.
package io.sentry.android.core;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep this one in core actually? I don't think it has anything remotely similar with the original ANRError nowadays, so I wouldn't really say it's borrowed anymore.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one feels a bit weird that it's called SentryShakeDetector but we put it under vendor 😅 I think we should either name it ShakeDetector or move it out of vendor (depending on how much it differs from the original source)

public fun rewind ()V
}

public final class io/sentry/vendor/aosp/threaddump/ThreadDumpParser {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should exclude **vendor** from the public API dump? These were not here previously, but now they are here because we moved them from internal

@romtsn romtsn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd address the comments, pre-approving.

One more thing - we should probably create an issue for dotnet to update their bindings after the bump (there's no compile-time error I think)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants